package com.hr.system.mapper;

import com.hr.emp.param.EmpInfo;
import com.hr.system.entity.SysMenu;
import com.hr.system.entity.SysUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hr.system.entity.SysUserRole;
import com.hr.system.entity.dto.SysUserDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author hr
 * @since 2024-04-19
 */

@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {

    List<SysUser> selectUserList(SysUser sysUser);

    List<String> getPermissionListByUserId(Integer id);

    List<SysUserDto> selectUserDtoList(SysUser sysUser);
    int insertRolesBatch(List<SysUserRole> list);

    List<SysMenu> selectUserMenus(Integer id);

//    @Update("update sys_user set state=#{state} where id=#{id}")
//    int changeState(Integer id, Integer state);

    @Update("update sys_user set state=#{state} where id=#{id}")
    Integer changeState(Integer id,Integer state);

    List<SysUser> getLeaderList(SysUserDto sysUserDto);

    int deleteByPrimaryKey(Long id);

    int insertSysUser(SysUser sysUser);

    int insertSelective(SysUser sysUser);

    SysUser selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysUser sysUser);

    int updateByPrimaryKey(SysUser sysUser);

    EmpInfo getEmpInfo(Integer id);

}
